

EXEC=pktHook

CC := $(CROSSCOMPILE)gcc

CFLAGS= -I./liblog/include -I./libxcap/include -Wall
LDFALGS= -L./liblog -llog -L./libxcap -lxcap -lpthread -pthread

SOURCE=$(wildcard *.c *.h)
OBJS=$(subst .c,.o,$(SOURCE))

all:liblog libxcap $(EXEC) 

liblog:
	make -C ./liblog
libxcap:
	make -C ./libxcap

$(EXEC): $(OBJS) 
	$(CC) $(CFLAGS) $(OBJS) -o $@ $(LDFALGS)


%.o:%.c
	$(CC) -c $(CFLAGS) $< -o $@ 

clean:
	rm *.o -f;
	rm $(EXEC)  -f;
	rm *.log -f;
	make clean -C ./liblog;
	make clean -C ./libxcap;

.PHONY: clean all liblog libxcap
